package com.maple.p2pclient;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;

import com.maple.p2pclient.ui.HomeActivity;
import com.maple.p2pclient.utils.PermissionUtils;

import java.util.List;

import androidx.appcompat.app.AppCompatActivity;

public class SplashActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        requestPermission();
    }

    private void requestPermission() {
        PermissionUtils.requestCamera(this, new PermissionUtils.RequestPermission() {

            @Override
            public void onRequestPermissionSuccess() {
                startActivity(new Intent(SplashActivity.this, HomeActivity.class));
            }

            @Override
            public void onRequestPermissionFailure(Context context, List<String> permissions) {

            }

            @Override
            public void onRequestPermissionFailureWithAskNeverAgain(Context context, List<String> permissions) {

            }
        });
    }

}